# 循环
# num = 10
# while num > 0:
#     print(num)
#     num -= 1

# 1+2+... 100
num = 1
psum = 0
while num <= 100:
    psum += num
    num += 1
print(psum)

# 1! + 2! .. 5!
num = 1
psum = 0
count = 1
while count <= 5:
    num = num*count
    psum += num
    count += 1
print(psum)

# range(1,11,2) [1,11) 步长为2
# for
# for i in range(1,11,2) :
#     print(i)

# for i in range(10,0,-1):
#     print(i)

# 1! + 2! + 3!...+5!
num = 1
sum = 0
for i in range(1,6):
    num *= i
    sum +=num
print(sum)